package com.xhdx.bussi;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

public class Test3 {
    
    public String getCurrDate(String format) {
        DateFormat format1 = new SimpleDateFormat(format);
        return format1.format(Long.valueOf(System.currentTimeMillis()));
    }
    public void set() {
        Long startTime = System.currentTimeMillis();
        Set<String> set = new HashSet<>();
        List<ActEaccinfo> actEaccinfoList = getActEaccinfo();
        set = actEaccinfoList.stream().map(actEaccinfo->actEaccinfo.getEacct()).collect(Collectors.toSet());
//        for (ActEaccinfo actEaccinfo:actEaccinfoList){
//            set.add(actEaccinfo.getEacct());
//        }
        List<CustomerDepositInfoList> xx = getCustomerDepositInfoList();
        for(CustomerDepositInfoList pp1:xx){
            if(set.contains(pp1.getAcct())){
                System.out.println("xxxxx==xxxxx");
            }
        }
        System.out.println("---set用时---"+(System.currentTimeMillis() - startTime));
    }
    public void list() {
        Long startTime = System.currentTimeMillis();
        List<ActEaccinfo> actEaccinfoList = getActEaccinfo(); 
        
        List<CustomerDepositInfoList> xx = getCustomerDepositInfoList();
        for(ActEaccinfo ae:actEaccinfoList){
            for(CustomerDepositInfoList pp1:xx){
                if(ae.getEacct().equals(pp1.getAcct())){
                    System.out.println("xxxxx==xxxxx");
                }
            }
        }
        
        System.out.println("---list用时---"+(System.currentTimeMillis() - startTime));
    }
    public void string() {
        Long startTime = System.currentTimeMillis();
        StringBuilder sb = new StringBuilder();
        List<ActEaccinfo> actEaccinfoList = getActEaccinfo(); 
        
        for (ActEaccinfo actEaccinfo:actEaccinfoList){
            sb.append(actEaccinfo.getEacct());
            sb.append(",");
        }
        String sbs = sb.toString();
        List<CustomerDepositInfoList> xx = getCustomerDepositInfoList();
        for(CustomerDepositInfoList pp1:xx){
            if(sbs.contains(pp1.getAcct())){
                System.out.println("xxxxx==xxxxx");
            }
        }
        System.out.println("---string用时---"+(System.currentTimeMillis() - startTime));
    }
    public static void main(String[] args) {
        for(int i=0;i<500;i++){
            Test3 t = new Test3();
            t.set();
        }
    }
    
    public List<ActEaccinfo> getActEaccinfo() {
        List<ActEaccinfo> actEaccinfoList = new ArrayList<>();
        ActEaccinfo aei = new ActEaccinfo();
        aei.setEacct("6210366450000994321");
        aei.setStatus(1);
        aei.setRsaStr("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房");
        
        ActEaccinfo aei1 = new ActEaccinfo();
        aei1.setEacct("6210366423001222885");
        aei1.setStatus(1);
        aei1.setRsaStr("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房0");
        
        ActEaccinfo aei2 = new ActEaccinfo();
        aei2.setEacct("6214586483800000649");
        aei2.setStatus(1);
        aei2.setRsaStr("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房1");
        
        ActEaccinfo aei3 = new ActEaccinfo();
        aei3.setEacct("6210366466666666666");
        aei3.setStatus(1);
        aei3.setRsaStr("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房2");
        
        ActEaccinfo aei4 = new ActEaccinfo();
        aei4.setEacct("6210366498001060053");
        aei4.setStatus(1);
        aei4.setRsaStr("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房2");
        
        actEaccinfoList.add(aei);
        actEaccinfoList.add(aei);
        actEaccinfoList.add(aei1);
        actEaccinfoList.add(aei2);
        actEaccinfoList.add(aei3);
        actEaccinfoList.add(aei4);
        
        return actEaccinfoList;
    }
    public List<CustomerDepositInfoList> getCustomerDepositInfoList() {
        List<CustomerDepositInfoList> actEaccinfoList = new ArrayList<>();
        CustomerDepositInfoList aei = new CustomerDepositInfoList();
        aei.setAcct("6210366450000994321");
        aei.setAcctKind("1212");
        aei.setCurrencyTyp("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房");
        
        CustomerDepositInfoList aei1 = new CustomerDepositInfoList();
        aei1.setAcct("6210366423001222885");
        aei1.setAcctKind("1212");
        aei1.setCurrencyTyp("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房0");
        
        CustomerDepositInfoList aei2 = new CustomerDepositInfoList();
        aei2.setAcct("6214586483800000649");
        aei2.setAcctKind("1212");
        aei2.setCurrencyTyp("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房1");
        
        CustomerDepositInfoList aei3 = new CustomerDepositInfoList();
        aei3.setAcct("6210366466666666666");
        aei3.setAcctKind("1212");
        aei3.setCurrencyTyp("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房2");
        
        CustomerDepositInfoList aei4 = new CustomerDepositInfoList();
        aei4.setAcct("6210366498001060053");
        aei4.setAcctKind("1212");
        aei4.setCurrencyTyp("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房2");
        
        CustomerDepositInfoList aei5 = new CustomerDepositInfoList();
        aei5.setAcct("62103664980010600153");
        aei5.setAcctKind("1212");
        aei5.setCurrencyTyp("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房2");
        
        CustomerDepositInfoList aei6 = new CustomerDepositInfoList();
        aei6.setAcct("62103664980010600156");
        aei6.setAcctKind("1212");
        aei6.setCurrencyTyp("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房2");
        
        CustomerDepositInfoList aei7 = new CustomerDepositInfoList();
        aei7.setAcct("62103664980010600157");
        aei7.setAcctKind("1212");
        aei7.setCurrencyTyp("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房2");
        
        
        CustomerDepositInfoList aei8 = new CustomerDepositInfoList();
        aei8.setAcct("62103664980010600158");
        aei8.setAcctKind("1212");
        aei8.setCurrencyTyp("kajfldfjkalfdasffadfafafafafdafdafafafdafaf科雷嘉的垃圾的房2");
        
        actEaccinfoList.add(aei);
        actEaccinfoList.add(aei);
        actEaccinfoList.add(aei1);
        actEaccinfoList.add(aei2);
        actEaccinfoList.add(aei3);
        actEaccinfoList.add(aei4);
        actEaccinfoList.add(aei5);
        actEaccinfoList.add(aei6);
        actEaccinfoList.add(aei7);
        actEaccinfoList.add(aei8);
        
        return actEaccinfoList;
    }
}
